using System;

namespace Sagile.Nepma
{
    /// <summary>
    /// Contains parameters for the <see cref="IExceptionReporter.TaskExceptionThrown"/> event.
    /// </summary>
    public class TaskExceptionThrownEventArgs : EventArgs
    {
        #region Attributes

        private string _id;
        private Exception _innerException;

        #endregion Attributes

        #region Properties

        /// <summary>
        /// Gets or sets the task id.
        /// </summary>
        /// <value>The task id.</value>
        public string TaskId
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// Gets or sets the inner exception.
        /// </summary>
        /// <value>The inner exception.</value>
        public Exception InnerException
        {
            get { return _innerException; }
            set { _innerException = value; }
        }

        #endregion Properties

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="TaskExceptionThrownEventArgs"/> class.
        /// </summary>
        /// <param name="taskId">The task id.</param>
        /// <param name="ex">The exception.</param>
        public TaskExceptionThrownEventArgs(string taskId, Exception ex)
        {
            _id = taskId;
            _innerException = ex;
        }

        #endregion Constructor
    }
}
